package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.vo.AgentCommissionTotalVO;
import com.lanchetech.bean.vo.UserAgentCommissionTotalVO;
import com.lanchetech.entity.AgentCommission;
import com.lanchetech.entity.UserCommission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface AgentCommissionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(AgentCommission record);

    int insertSelective(AgentCommission record);

    AgentCommission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AgentCommission record);

    int updateByPrimaryKey(AgentCommission record);

    List<AgentCommission> selectAllByAgentUserIdAndType(@Param("agentUserId") Long agentUserId, @Param("type") Byte type);

    AgentCommissionTotalVO getAgentCommissionTotal(PageReq req);

    List<AgentCommissionTotalVO> getAgentCommissionDetailByTimeType(@Param("agentUserId") Long agentUserId, @Param("type") Byte type, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<AgentCommissionTotalVO> getAgentCommissionDetail(PageReq req);

    int batchInsert(@Param("list") List<AgentCommission> list);

    UserAgentCommissionTotalVO getAgentCommissionByType(@Param("agentUserId") Long id, @Param("type") Byte type);
}